{include file="public:head" /}

<style>
  .user tr td {
	text-align: center;
  }
  .user tr td:nth-child(1) {
	width: 60px;
  }
  .layui-col-md4 {
	padding: 25px 0;
	color: #999;
	border-radius: 2px;
	transition: all 0.3s;
	text-align: center;
  }
  .layui-col-md4 h3 {
	font-size: 14px;
  }
  .layui-col-md4 p  {
	font-size: 24px;
	color: #009688;
	margin-top: 5px;
	cursor:pointer;
	border:none;
	text-align: center;
  }
  .layui-col-md4 input{
	font-size: 24px;
	color: #009688;
	margin-top: 5px;
	cursor:pointer;
	border:none;
	text-align: center;
  }
</style>

<div class="layui-fluid"  id="home">
  <div class="layui-row layui-col-space14">
	<!-- 站点统计 -->
	<div class="layui-col-sm12">
	  <div class="layui-card">
		<div class="layui-card-header">用户信息</div>
		<div class="layui-card-body">
		  <div class="layui-row layui-col-space12">
			<div class="layui-col-md4">
				<h3>总用户数量</h3>
				<p id="parentIframe">{$user_totl}</p>
			</div>
			<div class="layui-col-md4">
				<h3>普通正常用户</h3>
				<p id="parentIframe">{$user_person}</p>
			</div>
			<div class="layui-col-md4">
				<h3>内部账号</h3>
				<p id="parentIframe">{$user_spe}</p>
			</div>
		  </div>
		</div>
	  </div>
	</div>
	<!-- 站点统计 -->
	<div class="layui-col-sm12">
	  <div class="layui-card">
		<div class="layui-card-header">钻石数量</div>
		<div class="layui-card-body">
		  <div class="layui-row layui-col-space12">
			<div class="layui-col-md4">
				<h3>用户钻石总数量</h3>
				<p id="parentIframe">{$balance_totl}</p>
			</div>
			<div class="layui-col-md4">
				<h3>总充值钻石数量</h3>
				<p id="parentIframe">{$balance_re}</p>
			</div>
			<div class="layui-col-md4">
				<h3>总提现钻石数量</h3>
				<p id="parentIframe">{$balance_WR}</p>
			</div>
		  </div>
		</div>
	  </div>
	</div>

	<div class="layui-col-sm6">
	  <div class="layui-card">
		<div class="layui-card-header">真实用户新增统计</div>
		<div class="layui-card-body">
		  <div class="layui-row">
			<table class="layui-table user">
			  <tr>
				<td>时间</td>
				<td>新增数量</td>
			  </tr>
			  <tr>
				<td>今天</td>
				<td>{$today}</td>
			  </tr>
			  <tr>
				<td>昨天</td>
				<td>{$yesterday}</td>
			  </tr>
			  <tr>
				<td>近7天</td>
				<td>{$week}</td>
			  </tr>
			  <tr>
				<td>上周</td>
				<td>{$lastweek}</td>
			  </tr>
			  <tr>
				<td>近30天</td>
				<td>{$month}</td>
			  </tr>
			  <tr>
				<td>总计</td>
				<td>{$user_person}</td>
			  </tr>
			</table>
		  </div>
		</div>
	  </div>
	</div>

	<div class="layui-col-sm6">
	  <div class="layui-card">
		<div class="layui-card-header">日志信息</div>
		<div class="layui-card-body">
		  <div class="layui-row">
			<table class="layui-table user table-hover table-bordered table-list" id="menus-table" 	>
			  <thead>
			  <tr>
				<th class="tc">标题</th>
				<th class="tc">内容</th>
			  </tr>
			  </thead>
			  <tbody>
			  <?php foreach($list as $v){?>
				<tr>
				  <td class="tc">{$v.title}</td>
				  <td class="tc">{$v.log}</td>
				</tr>
			  <?php } ?>
			  </tbody>
			</table>
		  </div>
		</div>
	  </div>
	</div>

  </div>
</div>

<script>
  layui.use('form', function() {
	var form = layui.form
	var status = parseInt("")

	form.val('tabledata', {
	  'status': status
	})

	form.on('switch(onoff)', function(data) {
	  var status = data.elem.checked ? 1 : 0

	  layer.load()
	  $.post("{:url('update')}", { status: status }, function(res) {
		layer.closeAll()
		if (res.code !== 0) {
		  layer.msg('切换失败')
		}
	  })
	})
  })

  // 修改信息
  var update = function() {
	layer.open({
	  type: 2,
	  area: ['100%', '100%'],
	  title: "修改信息",
	  content: "{:url('index/update')}"
	})
  }

  	$('#parentIframe').on('click', function(){
	    layer.open({
	      type: 2,
	      title:'用户列表',
	      maxmin: true,
	      shadeClose: true, //点击遮罩关闭层
	      area : ['100%' , '100%'],
	      content: '{:url("user/index")}'
	    });
  	});
</script>
